package com.learn.designPatterns.behavioral.mediator;

/**
 * @classname:
 * @Description:
 * @author: yfpu
 * @Date: 2018-09-18 17:31
 */
public class Client {

    public static void main(String[] args) {
        Alarm alarm = new Alarm();
        CoffeePot coffeePot = new CoffeePot();
        Calender calender = new Calender();
        Sprinkler sprinkler = new Sprinkler();
        Mediator mediator = new Mediator(alarm, calender, coffeePot, sprinkler);

        //闹钟事件到达，调用中介者就可以操作相关对象
        alarm.doEvent(mediator);
    }
}
